﻿<%@ Page Language="C#"  AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableEventValidation="false" Theme="NewMemberSkin"%>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<script src="jquery-1.3.2.js" type="text/javascript" language="javascript"></script>

<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript" language="javascript">
        
        
    /*
        function mahmut()
        {   
            lblid.innerHTML="hello";
            lblid.innreHTML=lblid.innerHTML+document.getElementById("<%= ddlistCat1.ClientID %>").value;
            $("#lblid").hide().fadeIn(1000);
        }
    */    
        function addElement() {
          var div = document.getElementById("<%= selectedCategories.ClientID %>");
          var num = document.getElementById('newIdValue');
          var newnum = (document.getElementById('newIdValue').value -1)+ 2;
          num.value = newnum;
          var newdiv = document.createElement('div');
          var divIdName = 'my'+newnum+'Div';
          newdiv.setAttribute('id',divIdName);
          var selectedCategory=document.getElementById("<%= ddlistCat1.ClientID %>").value+"--->"+document.getElementById("<%= ddlistCat2.ClientID %>").value;
          newdiv.innerHTML = selectedCategory+ '<img src="images/cancel.png" alt="cancel" onclick="removeElement('+divIdName+')"></img>';
          div.appendChild(newdiv);
          $("#"+divIdName).hide().fadeIn(1000);
          
          // burda bişekilde secilen kategorileri code-behind da alacak sekilde bi yerde saklamak lazım.
          var list=document.getElementById("<%= list.ClientID %>");
        }
        
        function removeElement(divNum) {
            var d = document.getElementById("<%= selectedCategories.ClientID %>");
            var olddiv = document.getElementById(divNum.id);
            $("#"+divNum.id).fadeOut("slow",function(){
                d.removeChild(olddiv);
            });
            
        }
    </script>
    <link href="NewMemberStyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="mainForm" runat="server">
    <input  type="hidden" value="0"  id="newIdValue" />
    <div id="pageContainer" runat="server">
        <div id="headerContainer" runat="server">
            <div id="header">
              <div id="logo">
                  <asp:Image ID="Logo" runat="server" ImageUrl="~/images/gecici logo.png" />
               <!-- <p>Knowledge Sharing Community</p> -->
              </div>
            </div>
        </div>
        <div id="formContainer" runat="server">
            <div id="form">
              <div id="formInside">
                   <cc1:ToolkitScriptManager ID="scriptManager" runat="server" EnablePartialRendering="true"  >
                   </cc1:ToolkitScriptManager>
                <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
                    OnCreatingUser="CreateUserWizard1_CreatingUser" CancelButtonText="İptal" 
                    CompleteSuccessText="Kaydın başarıyla gerçekleşti." 
                    ContinueButtonText="Devam et" ContinueDestinationPageUrl="~/Default2.aspx" 
                    CreateUserButtonText="Kaydolun" DisableCreatedUser="True" 
                    DuplicateEmailErrorMessage="Email adresi sistemimizde kayıtlı." 
                    DuplicateUserNameErrorMessage="Girdiğin email adresi sistemimizde kayıtlı." 
                    FinishCompleteButtonText="Bitir" FinishPreviousButtonText="Önceki" 
                    InvalidEmailErrorMessage="Geçerli bir email adresi giriniz." 
                    LoginCreatedUser="False" 
                    UnknownErrorMessage="Kaydınız gerçekleşmedi.Lütfen tekrar deneyin." 
                    onsendingmail="CreateUserWizard1_SendingMail" 
                       oncreateduser="CreateUserWizard1_CreatedUser"  InstructionTextStyle-HorizontalAlign="NotSet" CreateUserButtonStyle-CssClass="buttonMain">
                    <MailDefinition BodyFileName="~/mailDefinition.htm" 
                        From="erdener.izm@gmail.com" IsBodyHtml="True" Priority="High" 
                        Subject="Ready to go">
                    </MailDefinition>
                    
<CreateUserButtonStyle CssClass="buttonMain"></CreateUserButtonStyle>
                    
                    <WizardSteps>
                        <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                            <ContentTemplate>
                               
                                <div id="errorMessages"  runat="server">
                                    <div class="padding" runat="server">
                                         <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                                ControlToValidate="UserName" ErrorMessage="Email adresini girmedin." 
                                                ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator ID="regexEmail" runat="server" ControlToValidate="UserName" 
                                                ErrorMessage="Doğru bir email adresi girmedin." 
                                                ValidationExpression="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$" 
                                                ValidationGroup="CreateUserWizard1">*</asp:RegularExpressionValidator>
                                           <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                                                ControlToValidate="Password" ErrorMessage="Şifre girmediniz." 
                                                ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" 
                                                ControlToValidate="ConfirmPassword" 
                                                ErrorMessage="Şifreyi tekrar girmediniz." 
                                              ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>     
                                            <asp:CompareValidator ID="PasswordCompare" runat="server" 
                                                ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                                Display="Dynamic" 
                                                ErrorMessage="Girdiğiniz şifreler aynı olmalı." 
                                                ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                                                <asp:RequiredFieldValidator ID="rqtxtName" runat="server" ErrorMessage="Adınızı girin."
                                                    ControlToValidate="txtName" ValidationGroup="CreateUserWizard1" >*</asp:RequiredFieldValidator>
                                          <asp:RequiredFieldValidator ID="rqtxtSurname" runat="server" ErrorMessage="Soyadınızı girin."
                                                    ControlToValidate="txtSurname" ValidationGroup="CreateUserWizard1" >*</asp:RequiredFieldValidator>
                                    </div>
                                </div>
                                <div id="literalBox" runat="server">
                                    <div class="padding" runat="server">
                                        <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                    </div>
                                </div>
                                
                                <div class="hidden" runat="server">
                                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
                                     <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                </div>
                                <div id="upperBox"  runat="server">
                                     <div class="padding" runat="server">
                                      <asp:UpdatePanel ID="updatePanel" runat="server">
                                     
                                    <ContentTemplate>
                                     <table>
                                         <tr>
                                         <td colspan="2"> <h1>1.  Kayıt bilgilerinizi giriniz.</h1></td>
                                         
                                         </tr>
                                         <tr>
                                             <td class="leftColumn">
                                                 <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Email:</asp:Label>
                                             </td>
                                             <td>
                                                 <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                             </td>
                                             
                                         </tr>
                                        
                                         <tr>
                                             <td class="leftColumn">
                                                 <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Şifre:</asp:Label>
                                             </td>
                                             <td>
                                                 <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                             </td>
                                             
                                         </tr>
                                         <tr>
                                             <td class="leftColumn">
                                                 <asp:Label ID="ConfirmPasswordLabel" runat="server" 
                                                     AssociatedControlID="ConfirmPassword">Şifre tekrar:</asp:Label>
                                             </td>
                                             <td>
                                                 <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                             </td>
                                             
                                         </tr>
                                         <tr>
                                         <td colspan="2"> <h1>2.  Bize kendinizi tanıtınız.</h1> </td>
                                         </tr>
                                         
                                         <tr>
                                            <td class="leftColumn">
                                                 <asp:Label ID="lblName" runat="server" AssociatedControlID="txtName">Adım :</asp:Label>
                                             </td>
                                             <td>
                                                 <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                                             </td>
                                         </tr>
                                         
                                         <tr>
                                            <td class="leftColumn">
                                                 <asp:Label ID="lblSurname" runat="server" AssociatedControlID="txtName">Soyadım :</asp:Label>
                                             </td>
                                             <td>
                                                 <asp:TextBox ID="txtSurname" runat="server"></asp:TextBox>
                                             </td>
                                         </tr>
                                         
                                         <tr>
                                            <td class="leftColumn">
                                             <asp:Label ID="LabelJob" runat="server" 
                                                     AssociatedControlID="ddlistJobs">Meslek:</asp:Label>
                                             </td>
                                             <td>
                                                 <asp:DropDownList ID="ddlistJobs" runat="server" AutoPostBack="false" 
                                                     ValidationGroup="signup">
                                                     <asp:ListItem Text="Mesleğinizi seçiniz" Value="Mesleğim"></asp:ListItem>
                                                 </asp:DropDownList>
                                             </td>
                                         </tr>
                                         
                                         <tr>
                                            <td align="center" colspan="2">
                                                 <asp:Label ID="Label3" runat="server" CssClass="why" EnableTheming="False">Niçin Mesleğimi Belirtmeliyim?</asp:Label>
                                                 <br />
                                                 <asp:Label ID="Label4" runat="server" CssClass="because" EnableTheming="False">Lama sizi doğrudan meslektaşlarınızla bilgi paylaşımı yapabileceğiniz ortamlara sokar.</asp:Label>
                                             </td>
                                         </tr>
                                         <tr >
                                             <td colspan="2">
                                                 <h1>
                                                     3. İlgi alanlarınızı tanıtınız.</h1>
                                             </td>
                                             <td colspan="2">
                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="center" colspan="2">
                                                <asp:Label ID="Label1" runat="server" CssClass="why" EnableTheming="False">Niçin Kategori Seçmeliyim?</asp:Label>
                                                     <br />
                                                     <asp:Label ID="Label2" runat="server" CssClass="because" EnableTheming="False">Lama size sadece bildiğiniz alanlardan soru gönderir.</asp:Label>
                                             </td>
                                         </tr>
                                         <tr>
                                             <td>
                                             </td>
                                             <td>
                                                <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" Category="cat1" 
                                                         LoadingText="[seçiliyor..]" PromptText="Ana Kategori Seçiniz.." 
                                                         ServiceMethod="GetDropDownContents" ServicePath="CategoryService.asmx" 
                                                         TargetControlID="ddlistCat1" />
                                                     <asp:DropDownList ID="ddlistCat1" runat="server">
                                                     </asp:DropDownList>
                                             </td>
                                         </tr>
                                         
                                         <tr>
                                             <td>
                                             </td>
                                             <td>
                                                 <cc1:CascadingDropDown ID="CascadingDropDown2" runat="server" Category="cat2" 
                                                         LoadingText="[seçiliyor..]" ParentControlID="ddlistCat1" 
                                                         PromptText="Alt Kategori Seçiniz.." ServiceMethod="GetDropDownContents" 
                                                         ServicePath="CategoryService.asmx" TargetControlID="ddlistCat2" />
                                                     <asp:DropDownList ID="ddlistCat2" runat="server">
                                                     </asp:DropDownList>
                                             </td>
                                         </tr>
                                         
                                         <tr>
                                             <td>
                                             </td>
                                             <td><div ID="selectedCategories" runat="server">
                                                     </div>
                                             </td>
                                         </tr>
                                         
                                         <tr>
                                         <td>
                                         </td>
                                         <td align="right">
                                         <div ID="buttonDiv" runat="server" align="center">
                                                     <input ID="btnAddCategory" runat="server" class="buttons" 
                                                         onclick="addElement()" type="button" value="Kategoriyi Ekle" />
                                                     <div ID="Div1" runat="server" class="hidden">
                                                         <!--classı hiddendan kaldırınca padding yap-->
                                                         <select ID="list" runat="server" name="D1">
                                                         </select> &nbsp;&nbsp;</div>
                                                 </div>
                                         </td>
                                         </tr>      
                                     </table>

                                </ContentTemplate>
                                    </asp:UpdatePanel>
                                </div>
                            </div>
                                    
                                    
                                 
                                    
                            </ContentTemplate>
                        </asp:CreateUserWizardStep>
                        <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"></asp:CompleteWizardStep>
                    </WizardSteps>
                </asp:CreateUserWizard>
              </div>
            </div>
        </div>
        
   
    </div>
    </form>
</body>
</html>
